from .common import *
def index():
    if sysisphone():
        return response.tpl("../tplm/task/index")
    else:
        return response.tpl()
def task():
    pagenow=request.args.get('pagenow')
    pagesize=request.args.get('pagesize')
    if not pagenow:
        pagenow=1
    else:
        pagenow=int(pagenow)
    if not pagesize:
        pagesize=10
    else:
        pagesize=int(pagesize)
    yz=Queues.getall(pagenow,pagesize)
    lists=yz[0]
    count=yz[1]
    data=return_list(lists,count,pagenow,pagesize)
    return successjson(data)
def taskstatus(taskid):
    return successjson(Queues.status(taskid))